Security News
RubyGems.org Adds New Maintainer Role
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.
This is a browser-friendly implementation of ksuid in JavaScript. The implementation is extended to produce UIDs in descending order, which is beneficial in certain cases, e.g. when used as a key for KV Cloudflare worker storage entries that should be listed in descending order.
Binary keys generated in ascending order per reference KSUID implementation are 20 bytes long,
whereas extended KSUIDs are 21 bytes long and are always starting with 61
, indicating that timestamp value
is calculated as a difference between the maximum possible value (max 32bit unsigned integer) and seconds since 14e8
:
# KSUID - Ascending order
4 bytes 16 bytes
[ ][ ][ ][ ] [ ][ ][ ]...[ ][ ][ ]
sec since 14e8 random bytes
# xKSUID - Descending order
1 byte 4 bytes 16 bytes
[ 61 ] [ ][ ][ ][ ] [ ][ ][ ]...[ ][ ][ ]
'z' sec till MAX random bytes
Text representation for KSUID is 27 characters long, and 28 characters long with xKSUID, starting with z
:
# KSUID
24bxFgAT8RPOk01OWecxD8bcLKo
#xKSUID
zYS4GmVK9Hn2JHPota8SAOBQsPgR
API:
generate() // ASC KSUID
generate(true) // DESC xKSUID
generate(true,new Date('2022-01-01').getTime()) // DESC xKSUID with custom timestamp
Via CDN:
<script>
import {generate} from 'https://cdn.jsdelivr.net/npm/xksuid@0.0.3/src/index.js'
</script>
Via NPM:
npm install xksuid
For browser:
import {generate} from 'xksuid'
For NodeJS ESM:
import {generate} from 'xksuid'
For NodeJS CommonJS:
const {generate} = await import('xksuid')
> xksuid@0.0.1 benchmark
> node benchmark.js
8 x Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Running 100000 ops
3535.918315887451 ms 35.359183158874515 ns/op 28281.196302155477 ops/sec
FAQs
Extended K-Sortable UID for browser & NodeJS 16+
We found that xksuid demonstrated a healthy version release cadence and project activity because the last version was released less than 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
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.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.