UNPKG

@0xcert/utils

Version:

General utility module with common helper functions.

20 lines 1.26 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); const spec_1 = require("@hayspec/spec"); const sha_1 = require("../../methods/sha"); const spec = new spec_1.Spec(); spec.test('converts string into SHA256 hash', (ctx) => __awaiter(void 0, void 0, void 0, function* () { ctx.is(yield sha_1.sha(256, 'foo#'), '18845243706c9f9a00b514348b58edd82fe708a68393ccbb3f70e1599577a148'); ctx.is(yield sha_1.sha(256, 'bar!'), 'e687b749f2cd93615923a2f705faace4033f35d57ccfca652cdc39616a94a3c2'); })); exports.default = spec; //# sourceMappingURL=sha.test.js.map