Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kroid/angular-uuid
Generate a random uuid.
https://github.com/kroid/angular-uuid
Last synced: about 2 months ago
JSON representation
Generate a random uuid.
- Host: GitHub
- URL: https://github.com/kroid/angular-uuid
- Owner: Kroid
- Created: 2014-10-23T13:20:07.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-23T13:29:55.000Z (about 10 years ago)
- Last Synced: 2024-10-08T19:17:34.233Z (3 months ago)
- Homepage:
- Size: 129 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
angular-uuid
============angular.module('your-app', ['kroid-uuid'])
Generate a random uuid.
Based on Math.uuid.js (v1.4) ( http://www.broofa.com mailto:[email protected] 2010 Robert Kieffer )USAGE: uuid(length, radix)
length - the desired number of characters
radix - the number of allowable values for each character.EXAMPLES:
No arguments - returns RFC4122, version 4 ID
>>> uuid()
"92329D39-6F5C-4520-ABFC-AAB64544E172"One argument - returns ID of the specified length
>>> uuid(15) // 15 character ID (default base=62)
"VcydxgltxrVZSTV"// Two arguments - returns ID of the specified length, and radix. (Radix must be <= 62)
>>> uuid(8, 2) // 8 character ID (base=2)
"01001010"
>>> uuid(8, 10) // 8 character ID (base=10)
"47473046"
>>> uuid(8, 16) // 8 character ID (base=16)
"098F4D35"