Path: blob/master/node_modules/@bochilteam/scraper/lib/cjs/encryptions/test.js
1126 views
"use strict";1Object.defineProperty(exports, "__esModule", { value: true });2const chai_1 = require("chai");3const index_js_1 = require("./index.js");4describe('Encryptions', () => {5describe('Base64', () => {6it('From string to base64', done => {7try {8const res = (0, index_js_1.toBase64)('Hello World!!');9(0, chai_1.expect)(res).to.be.a('string');10(0, chai_1.expect)(res).to.be.equal('SGVsbG8gV29ybGQhIQ==');11return done();12}13catch (e) {14return done(e);15}16});17it('from base64 to string', done => {18try {19const res = (0, index_js_1.fromBase64ToString)('SGVsbG8gV29ybGQhIQ==');20(0, chai_1.expect)(res).to.be.a('string');21(0, chai_1.expect)(res).to.be.equal('Hello World!!');22return done();23}24catch (e) {25return done(e);26}27});28});29describe('Crypto', () => {30it('randomUUID', done => {31try {32const res = (0, index_js_1.randomUUID)();33(0, chai_1.expect)(res).to.be.a('string');34return done();35}36catch (e) {37return done(e);38}39});40it('randomBytes', done => {41try {42const res = (0, index_js_1.randomBytes)(16);43(0, chai_1.expect)(res).to.be.a('string');44return done();45}46catch (e) {47return done(e);48}49});50it('createHash', done => {51try {52const res = (0, index_js_1.createHash)('sha256', 'Hello world!!');53(0, chai_1.expect)(res).to.be.a('string');54(0, chai_1.expect)(res).to.have.length(64);55return done();56}57catch (e) {58return done(e);59}60});61});62});63//# sourceMappingURL=test.js.map6465