
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
@ssc-half-light/util
Advanced tools
Utility functions
Depends on uint8arrays and @oddjs/odd.
npm i @ssc-half-light/util
Works in node or browsers.
async (did:string, sig:string, msg:string):Promise<boolean>
import { verify } from '@ssc-half-light/util'
const DID = 'did:key:z13V3Sog2Ya...'
const sig = 'X8iGF4Lz4erw4UE...'
const isValid = await verify(DID, sig, 'my message')
(keystore:KeyStore, msg:string):Promise<Uint8Array>
This depends on a keystore instance.
import { sign, toString } from '@ssc-half-light/util'
import * as odd from '@oddjs/odd'
const program = await odd.program({
namespace: { creator: 'test', name: 'testing' },
debug: true
})
const { keystore } = program.components.crypto
const sig = toString(await sign(keystore, 'my message'))
Return a 'base64url' string. Good for getting a string version of a signature.
function toString (arr:Uint8Array):string
test('toString', t => {
const myString = toString(myUint8Array)
t.equal(typeof myString, 'string', 'should conver a Uint8Array to string')
})
Convert a given public key to a DID string.
async function writeKeyToDid (crypto:Crypto.Implementation):Promise<DID>
import { writeKeyToDid } from '@ssc-half-light/util'
test('writeKeyToDid', async t => {
const crypto = program.components.crypto
const did = await writeKeyToDid(crypto)
console.log('**did**', did)
t.equal(typeof did, 'string', 'should create string')
t.ok(did.includes('did:key:'), 'should return the right format string')
})
Convert a DID string to a Uint8Array and type string.
function didToPublicKey (did:string):({
publicKey:Uint8Array,
type: 'rsa' | 'ed25519' | 'bls12-381'
})
Get the DID version of the key used to sign messages.
test('didToPublicKey', t => {
const did = 'did:key:z13...'
const pubKey = didToPublicKey(did)
t.equal(pubKey.type, 'rsa', 'should return the right key type')
t.ok(pubKey.publicKey instanceof Uint8Array,
'should return the public key as a Uint8Array')
})
FAQs
Utility functions related to the webcrypto API
The npm package @ssc-half-light/util receives a total of 1 weekly downloads. As such, @ssc-half-light/util popularity was classified as not popular.
We found that @ssc-half-light/util demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.