MCPcopy Create free account
hub / github.com/PaperDebugger/paperdebugger / bytesToWords

Function bytesToWords

webapp/_webapp/src/libs/helpers.ts:93–97  ·  view source on GitHub ↗
(bytes: Uint8Array)

Source from the content-addressed store, hash-verified

91
92// Convert a byte array to big-endian 32-bit words
93function bytesToWords(bytes: Uint8Array): number[] {
94 const words: number[] = [];
95 for (let i = 0, b = 0; i < bytes.length; i++, b += 8) words[b >>> 5] |= bytes[i] << (24 - (b % 32));
96 return words;
97}
98
99// Convert big-endian 32-bit words to a byte array
100function wordsToBytes(words: number[]) {

Callers 1

generateSHA1HashFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected