MCPcopy Create free account
hub / github.com/cloudflare/serverless-registry / stringToArrayBuffer

Function stringToArrayBuffer

src/user.ts:41–45  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

39}
40
41function stringToArrayBuffer(s: string): Uint8Array {
42 const encoder = new TextEncoder();
43 const arr = encoder.encode(s);
44 return arr;
45}
46
47export async function getSHA256(data: string, prefix: string = SHA256_PREFIX + ":"): Promise<string> {
48 const sha256 = new crypto.DigestStream("SHA-256");

Callers 1

checkCredentialsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected