File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ From the community!
8181| [ PowerShell] ( https://github.com/PetterBomban/posh-ulid ) | [ PetterBomban] ( https://github.com/PetterBomban ) |
8282| [ Python] ( https://github.com/mdipierro/ulid ) | [ mdipierro] ( https://github.com/mdipierro ) |
8383| [ Python] ( https://github.com/ahawker/ulid ) | [ ahawker] ( https://github.com/ahawker ) | ✓ |
84+ | [ Python] ( https://github.com/mdomke/python-ulid ) | [ mdomke] ( https://github.com/mdomke ) | ✓ |
8485| [ Ruby] ( https://github.com/rafaelsales/ulid ) | [ rafaelsales] ( https://github.com/rafaelsales ) |
8586| [ Rust] ( https://github.com/mmacedoeu/rulid.rs ) | [ mmacedoeu] ( https://github.com/mmacedoeu/rulid.rs ) | ✓ |
8687| [ Rust] ( https://github.com/dylanhart/ulid-rs ) | [ dylanhart] ( https://github.com/dylanhart ) | ✓ |
Original file line number Diff line number Diff line change @@ -81,18 +81,18 @@ function factory(prng) {
8181
8282/* istanbul ignore next */
8383function _prng ( root ) {
84+ var crypto = root && ( root . crypto || root . msCrypto )
8485
85- if ( root ) {
86+ if ( crypto ) {
8687 try {
87- var crypto = root . crypto || root . msCrypto
8888 return function ( ) {
8989 return crypto . getRandomValues ( new Uint16Array ( 1 ) ) [ 0 ] / 0xFFFF
9090 }
9191 }
9292 catch ( e ) { }
9393 } else {
9494 try {
95- var crypto = require ( "crypto" )
95+ crypto = require ( "crypto" )
9696 return function ( ) {
9797 return crypto . randomBytes ( 2 ) . readUInt16LE ( ) / 0xFFFF
9898 }
You can’t perform that action at this time.
0 commit comments