version.js 200 B

1234567891011
  1. import validate from './validate.js';
  2. function version(uuid) {
  3. if (!validate(uuid)) {
  4. throw TypeError('Invalid UUID');
  5. }
  6. return parseInt(uuid.substr(14, 1), 16);
  7. }
  8. export default version;