MCPcopy Create free account
hub / github.com/allocnode/oh-my-sage / encodePointForHash

Method encodePointForHash

ref/gateway_client.js:111–118  ·  view source on GitHub ↗
(point)

Source from the content-addressed store, hash-verified

109 }
110
111 encodePointForHash(point) {
112 const result = Buffer.alloc(69);
113 result.writeUInt32BE(65, 0);
114 result[4] = 4;
115 Buffer.from(point.getX().toArray('be', 32)).copy(result, 5);
116 Buffer.from(point.getY().toArray('be', 32)).copy(result, 37);
117 return result;
118 }
119
120 decodePoint(data) {
121 if (data[0] !== 65 || data[1] !== 4) throw new Error('Invalid point format');

Callers 1

zkpHashMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected