11 lines
200 B
JavaScript
11 lines
200 B
JavaScript
|
import validate from './validate.js';
|
||
|
|
||
|
function version(uuid) {
|
||
|
if (!validate(uuid)) {
|
||
|
throw TypeError('Invalid UUID');
|
||
|
}
|
||
|
|
||
|
return parseInt(uuid.slice(14, 15), 16);
|
||
|
}
|
||
|
|
||
|
export default version;
|