MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / berRoundTrip

Function berRoundTrip

tests/modules/crypt/ber/integer.js:23–27  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

21berRoundTrip(-129n);
22
23function berRoundTrip(value) {
24 let ber = BER.encode([0x02, value]);
25 let v = BER.decode(ber);
26 assert.sameValue(value, v[1]);
27}

Callers 1

integer.jsFile · 0.70

Calls 2

encodeMethod · 0.65
decodeMethod · 0.65

Tested by

no test coverage detected