@hashgraph/cryptography
Version:
Cryptographic utilities and primitives for the Hiero SDK
18 lines (15 loc) • 317 B
JavaScript
import nacl from "tweetnacl";
/**
* @param {number} count
* @returns {Uint8Array}
*/
export function bytes(count) {
return nacl.randomBytes(count);
}
/**
* @param {number} count
* @returns {Promise<Uint8Array>}
*/
export function bytesAsync(count) {
return Promise.resolve(nacl.randomBytes(count));
}