UNPKG

stellar-plus

Version:

beta version of stellar-plus, an all-in-one sdk for the Stellar blockchain

15 lines (14 loc) 577 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.generateRandomSalt = void 0; const buffer_1 = require("buffer"); const generateRandomSalt = () => { let salt = ''; const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; // Base64 characters const charactersLength = characters.length; for (let i = 0; i < 32; i++) { salt += characters.charAt(Math.floor(Math.random() * charactersLength)); } return buffer_1.Buffer.from(salt); }; exports.generateRandomSalt = generateRandomSalt;