hapi-ton-sdk
Version:
SDK for managing HAPI attestations on TON network
53 lines (50 loc) • 1.61 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/types/index.ts
var types_exports = {};
__export(types_exports, {
OpCode: () => OpCode
});
module.exports = __toCommonJS(types_exports);
// src/utils/crc32.ts
function crc32(str) {
const table = new Int32Array(256);
for (let i = 0; i < 256; i++) {
let c = i;
for (let j = 0; j < 8; j++) {
c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
}
table[i] = c;
}
let crc = -1;
for (let i = 0; i < str.length; i++) {
crc = crc >>> 8 ^ table[(crc ^ str.charCodeAt(i)) & 255];
}
return (crc ^ -1) >>> 0;
}
// src/types/index.ts
var OpCode = {
createAttestation: crc32("create_attestation"),
updateAttestation: crc32("update_attestation")
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
OpCode
});
//# sourceMappingURL=index.js.map