Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
The uuid-parse npm package provides utilities for parsing and formatting UUIDs. It allows you to convert UUIDs between string and byte array representations, which can be useful for various applications such as database storage, network transmission, and more.
UUID to Byte Array
This feature allows you to convert a UUID string into a byte array. This can be useful for storing UUIDs in a more compact binary format.
const uuidParse = require('uuid-parse');
const uuid = '550e8400-e29b-41d4-a716-446655440000';
const bytes = uuidParse.parse(uuid);
console.log(bytes);
Byte Array to UUID
This feature allows you to convert a byte array back into a UUID string. This is useful for converting stored binary UUIDs back into their string representation.
const uuidParse = require('uuid-parse');
const bytes = [85, 14, 132, 0, 226, 155, 65, 212, 167, 22, 68, 102, 85, 68, 0, 0];
const uuid = uuidParse.unparse(bytes);
console.log(uuid);
The 'uuid' package is a popular library for generating and validating UUIDs. Unlike uuid-parse, it focuses more on the creation and validation of UUIDs rather than parsing and formatting. It provides methods to generate UUIDs of different versions (v1, v3, v4, v5).
The 'node-uuid' package is another library for generating UUIDs. It is similar to the 'uuid' package but is an older implementation. It also provides methods for generating UUIDs of different versions but does not focus on parsing and formatting like uuid-parse.
The 'uuid-js' package is a JavaScript library for generating and parsing UUIDs. It provides similar functionalities to uuid-parse but also includes additional features like generating UUIDs based on timestamps and random numbers.
Simple, fast parsing and unparsing of RFC4122 UUIDS.
Features:
npm install uuid-parse
const uuidParse = require('uuid-parse');
Parse and unparse UUIDs
id
- (String) UUID(-like) stringbuffer
- (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Buffer is usedoffset
- (Number) Starting index in buffer
at which to begin writing. Default: 0Example parsing and unparsing a UUID string
const bytes = uuidParse.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> <Buffer 79 7f f0 43 11 eb 11 e1 80 d6 51 09 98 75 5d 10>
const string = uuidParse.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10'
npm test
Please make sure to check out the repository that originated these functions: node-uuid. These functions were removed from a recent version of that library and I wanted to make sure they were still exposed for the packages who were dependent on them.
FAQs
RFC4122 UUID parser
The npm package uuid-parse receives a total of 63,564 weekly downloads. As such, uuid-parse popularity was classified as popular.
We found that uuid-parse demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.