MCPcopy Index your code
hub / github.com/angular/angular / computeNativeSha256

Function computeNativeSha256

packages/common/http/test/transfer_cache_spec.ts:1144–1149  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

1142
1143 describe('generateHash', () => {
1144 async function computeNativeSha256(value: string): Promise<string> {
1145 const msgUint8 = new TextEncoder().encode(value);
1146 const hashBuffer = await crypto.subtle.digest('SHA-256', msgUint8);
1147 const hashArray = Array.from(new Uint8Array(hashBuffer));
1148 return hashArray.map((b) => b.toString(16).padStart(2, '0')).join('');
1149 }
1150
1151 it('should generate standard SHA-256 hashes matching Web Crypto specs', async () => {
1152 const testCases = [

Callers 1

Calls 4

mapMethod · 0.80
joinMethod · 0.65
toStringMethod · 0.65
digestMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…