Socket
Socket
Sign inDemoInstall

@hapi/cryptiles

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hapi/cryptiles - npm Package Compare versions

Comparing version 5.0.0 to 5.1.0

11

lib/index.d.ts

@@ -13,2 +13,13 @@ /**

/**
Generate a cryptographically strong pseudo-random alphanumeric data
@param size - Size of the string
@returns A cryptographically strong pseudo-random alphanumeric data
*/
export function randomAlphanumString(size: number): string;
/**
Return a random string of digits

@@ -15,0 +26,0 @@

@@ -21,2 +21,17 @@ 'use strict';

// Generate a cryptographically strong pseudo-random alphanum data
exports.randomAlphanumString = function (size) {
let result = '';
while (result.length < size) {
const buffer = exports.randomBits((size + 1) * 6);
result += buffer.toString('base64').replace(/[^a-zA-Z0-9]/g, '');
}
return result.slice(0, size);
};
// Return a random string of digits

@@ -23,0 +38,0 @@

5

package.json
{
"name": "@hapi/cryptiles",
"description": "General purpose crypto utilities",
"version": "5.0.0",
"version": "5.1.0",
"repository": "git://github.com/hapijs/cryptiles",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"engines": {
"node": ">=12.0.0"
},
"files": [

@@ -9,0 +12,0 @@ "lib"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc