Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@appliedblockchain/helpers

Package Overview
Dependencies
Maintainers
25
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@appliedblockchain/helpers - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

uuid-string-of-buffer.js

2

package.json
{
"name": "@appliedblockchain/helpers",
"version": "2.0.2",
"version": "2.0.3",
"description": "No dependency, single file helpers.",

@@ -5,0 +5,0 @@ "main": "index.js",

// @flow
const { randomBytes } = require('crypto')
const { mask, variantRfc4122 } = require('./uuid')
const uuidStringOfBuffer = require('./uuid-string-of-buffer')
const h = []
for (let i = 0; i < 0xff; ++i) {
h[i] = i.toString(16).padStart(2, '0')
function uuidV4() /*: string */ {
return uuidStringOfBuffer(mask(randomBytes(16), 4, variantRfc4122))
}
function uuidV4() {
const x = randomBytes(16)
x[6] = (x[6] & 0x0f) | 0x40
x[8] = (x[8] & 0x3f) | 0x80
return [
h[x[0]], h[x[1]], h[x[2]], h[x[3]], '-',
h[x[4]], h[x[5]], '-',
h[x[6]], h[x[7]], '-',
h[x[8]], h[x[9]], '-',
h[x[10]], h[x[11]], h[x[12]], h[x[13]], h[x[14]], h[x[15]]
].join('')
}
module.exports = uuidV4
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