{"_id":"win-guid","_rev":"9-d90f52dd290ac2665138d72c72f79ab9","name":"win-guid","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.3":{"name":"win-guid","version":"0.1.3","keywords":["GUID","Windows","COM"],"author":{"url":"https://github.com/Borewit","name":"Borewit"},"license":"MIT","_id":"win-guid@0.1.3","maintainers":[{"name":"borewit","email":"borewit@xs4all.nl"}],"homepage":"https://github.com/Borewit/win-guid#readme","bugs":{"url":"https://github.com/Borewit/win-guid/issues"},"dist":{"shasum":"51e055e8a82d7bbf88e2c3fe7bbe42f4f63b9276","tarball":"https://registry.npmjs.org/win-guid/-/win-guid-0.1.3.tgz","fileCount":5,"integrity":"sha512-Ah25z4XnblBGFgrcVS5QK7qLkvsFFA35+G+AnHkELUPHXPYWFOSVNMuAxf1zW0B+4X911IBLD+TvB771om0gmg==","signatures":[{"sig":"MEUCIQDpz8u+kGWy2etK+vqSWTEDcUVWZBJY9klB4x0lUm5CmwIgFUNpjlqyBd65t6gKLdn0kO0R+esrwZLTA0fjeCKX/JY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8800},"main":"index.js","type":"module","exports":"./lib/guid.js","gitHead":"bc7cd868af36fe15f83b59e23389c960827ff676","scripts":{"test":"mocha","build":"yarn run clean && yarn run compile","clean":"del-cli 'lib/**/*.js' 'lib/**/*.js.map' 'lib/**/*.d.ts' 'src/**/*.d.ts'","format":"biome format","compile":"yarn run compile-src","lint:ts":"biome check","compile-src":"tsc -p lib","update-biome":"yarn add -D --exact @biomejs/biome && npx @biomejs/biome migrate --write","prepublishOnly":"yarn run build"},"_npmUser":{"name":"borewit","email":"borewit@xs4all.nl"},"repository":{"url":"git+https://github.com/Borewit/win-guid.git","type":"git"},"_npmVersion":"10.9.4","description":"Windows GUID","directories":{},"_nodeVersion":"22.21.1","_hasShrinkwrap":false,"packageManager":"yarn@4.9.1","devDependencies":{"chai":"^6.2.2","biome":"^0.3.3","mocha":"^11.7.5","del-cli":"^7.0.0","typescript":"^5.9.3","@types/chai":"^5.2.3","@types/mocha":"^10.0.10"},"_npmOperationalInternal":{"tmp":"tmp/win-guid_0.1.3_1768333287454_0.30640075855375226","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"win-guid","version":"0.2.0","keywords":["GUID","Windows","COM"],"author":{"url":"https://github.com/Borewit","name":"Borewit"},"license":"MIT","_id":"win-guid@0.2.0","maintainers":[{"name":"borewit","email":"borewit@xs4all.nl"}],"homepage":"https://github.com/Borewit/win-guid#readme","bugs":{"url":"https://github.com/Borewit/win-guid/issues"},"dist":{"shasum":"63180c34e127f72ada4f4d9cdad5b132d3f0384a","tarball":"https://registry.npmjs.org/win-guid/-/win-guid-0.2.0.tgz","fileCount":5,"integrity":"sha512-iekGhWzFQSunvE87ndXxoa6UgyQbkL4MmbYTFhQnk94pVsAW89mWnvW1zI3JMnypUm8jykJaITudspoR8NrRBQ==","signatures":[{"sig":"MEQCIEoVWIVWczX55fURuqb6pVKpU/W8UmfZvdvBuCXVWB7VAiBoeZXeURBhDgZCCrgUNWZcLJilBmcn+5GB0iY+2reRwg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9741},"main":"index.js","type":"module","exports":"./lib/guid.js","gitHead":"b0482ef180a285679474268edadc0652a9980cd1","scripts":{"test":"mocha","build":"yarn run clean && yarn run compile","clean":"del-cli 'lib/**/*.js' 'lib/**/*.js.map' 'lib/**/*.d.ts' 'src/**/*.d.ts'","format":"biome format","compile":"yarn run compile-src","lint:ts":"biome check","compile-src":"tsc -p lib","update-biome":"yarn add -D --exact @biomejs/biome && npx @biomejs/biome migrate --write","prepublishOnly":"yarn run build"},"_npmUser":{"name":"borewit","email":"borewit@xs4all.nl"},"repository":{"url":"git+https://github.com/Borewit/win-guid.git","type":"git"},"_npmVersion":"10.9.4","description":"Windows GUID","directories":{},"_nodeVersion":"22.21.1","_hasShrinkwrap":false,"packageManager":"yarn@4.9.1","devDependencies":{"chai":"^6.2.2","biome":"^0.3.3","mocha":"^11.7.5","del-cli":"^7.0.0","typescript":"^5.9.3","@types/chai":"^5.2.3","@types/mocha":"^10.0.10"},"_npmOperationalInternal":{"tmp":"tmp/win-guid_0.2.0_1768666601495_0.7850382272650855","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"win-guid","version":"0.2.1","description":"Windows legacy GUID parser","type":"module","exports":"./lib/guid.js","scripts":{"clean":"del-cli 'lib/**/*.js' 'lib/**/*.js.map' 'lib/**/*.d.ts' 'src/**/*.d.ts'","compile-src":"tsc -p lib","compile":"yarn run compile-src","format":"biome format","lint:ts":"biome check","build":"yarn run clean && yarn run compile","test":"mocha","prepublishOnly":"yarn run build","update-biome":"yarn add -D --exact @biomejs/biome && npx @biomejs/biome migrate --write"},"author":{"name":"Borewit","url":"https://github.com/Borewit"},"repository":{"type":"git","url":"git+https://github.com/Borewit/win-guid.git"},"license":"MIT","devDependencies":{"@types/chai":"^5.2.3","@types/mocha":"^10.0.10","biome":"^0.3.3","chai":"^6.2.2","del-cli":"^7.0.0","mocha":"^11.7.5","typescript":"^5.9.3"},"packageManager":"yarn@4.9.1","keywords":["GUID","Windows","COM","CFBF","registry","UEFI","objectGUID","GPT","endianness","OLE","binary"],"_id":"win-guid@0.2.1","gitHead":"b7f40c13aac1a21ea600cc188d6a2a01740d5335","bugs":{"url":"https://github.com/Borewit/win-guid/issues"},"homepage":"https://github.com/Borewit/win-guid#readme","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-gEIQU4mkgl2OPeoNrWflcJFJ3Ae2BPd4eCsHHA/XikslkIVms/nHhvnvzIZV7VLmBvtFlDOzLt9rrZT+n6D67A==","shasum":"576915ba5e10bf92ec6a32b71ab06b5f75403fc0","tarball":"https://registry.npmjs.org/win-guid/-/win-guid-0.2.1.tgz","fileCount":5,"unpackedSize":10721,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCeExh6EjXD3+b2X83jLQ5JvTeO5rDdlaeGkXKy4EeGlQIhAMPtmB2/l6R3tAcf5l+Rb89uyt0dkTOcKoKFv/lYI8yf"}]},"_npmUser":{"name":"borewit","email":"borewit@xs4all.nl"},"directories":{},"maintainers":[{"name":"borewit","email":"borewit@xs4all.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/win-guid_0.2.1_1769676683313_0.4481344098351656"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-13T19:30:35.455Z","modified":"2026-01-29T08:51:23.567Z","0.1.0":"2026-01-13T19:30:35.604Z","0.1.1":"2026-01-13T19:33:38.883Z","0.1.2":"2026-01-13T19:38:36.292Z","0.1.3":"2026-01-13T19:41:27.623Z","0.2.0":"2026-01-17T16:16:41.647Z","0.2.1":"2026-01-29T08:51:23.452Z"},"bugs":{"url":"https://github.com/Borewit/win-guid/issues"},"author":{"name":"Borewit","url":"https://github.com/Borewit"},"license":"MIT","homepage":"https://github.com/Borewit/win-guid#readme","keywords":["GUID","Windows","COM","CFBF","registry","UEFI","objectGUID","GPT","endianness","OLE","binary"],"repository":{"type":"git","url":"git+https://github.com/Borewit/win-guid.git"},"description":"Windows legacy GUID parser","maintainers":[{"name":"borewit","email":"borewit@xs4all.nl"}],"readme":"[![NPM version](https://img.shields.io/npm/v/win-guid.svg)](https://npmjs.org/package/win-guid)\r\n[![Node.js CI](https://github.com/Borewit/win-guid/actions/workflows/nodejs-ci.yml/badge.svg)](https://github.com/Borewit/win-guid/actions/workflows/nodejs-ci.yml)\r\n[![npm downloads](http://img.shields.io/npm/dm/win-guid.svg)](https://npmcharts.com/compare/win-guid?start=365)\r\n\r\n# win-guid\r\n\r\nA module for encoding and decoding **Windows legacy GUIDs** using the **Windows GUID byte layout**,\r\na mixed-endianness format used by several long-standing Microsoft and firmware standards, including:\r\n\r\n- [Component Object Model (COM)](https://en.wikipedia.org/wiki/Component_Object_Model)\r\n- [Object Linking and Embedding (OLE)](https://en.wikipedia.org/wiki/Object_Linking_and_Embedding)\r\n- [Compound File Binary Format (CFBF, Structured Storage)](https://en.wikipedia.org/wiki/Compound_File_Binary_Format)\r\n- [GUID Partition Table (GPT)](https://en.wikipedia.org/wiki/GUID_Partition_Table)\r\n- [Unified Extensible Firmware Interface (UEFI)](https://en.wikipedia.org/wiki/UEFI)\r\n- [Windows Registry](https://en.wikipedia.org/wiki/Windows_Registry) binary GUID values\r\n- [Active Directory](https://en.wikipedia.org/wiki/Active_Directory) objectGUID values\r\n\r\nThis is commonly needed when working with Microsoft file and storage formats, such as `.asf`, `.doc`, `.xls`, `.ppt`,\r\nand other binary formats based on OLE/COM Structured Storage (CFBF),\r\nwhere GUIDs are stored in Windows byte order rather than [RFC 9562](https://www.rfc-editor.org/rfc/rfc9562.html)-style UUID order.\r\n\r\n## Windows legacy GUID byte layout vs RFC 9562 UUID byte layout\r\n\r\nThe table below shows how GUID `00112233-4455-6677-8899-AABBCCDDEEFF` is serialized as an [RFC 9562](https://www.rfc-editor.org/rfc/rfc9562.html) UUID versus a Windows GUID:\r\n\r\n| UUID / GUID type | Serialized byte layout (hexadecimal) |\r\n|-------------------------|---------------------------------------------------|\r\n| RFC 9562 UUID layout | `00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF` |\r\n| Windows GUID layout | `33 22 11 00 55 44 77 66 88 99 AA BB CC DD EE FF` |\r\n\r\nWindows legacy GUID layout reorders only the first three fields (32-bit, 16-bit, 16-bit). The remaining 8 bytes are stored as-is.\r\n\r\nFor [RFC 9562](https://www.rfc-editor.org/rfc/rfc9562.html) compliant UUIDs (network byte order), use [uuid](https://github.com/uuidjs/uuid) instead.\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install win-guid\r\n```\r\n\r\n## Usage\r\n\r\n### Parse a GUID string\r\n\r\nParses a canonical GUID string:\r\n```js\r\nimport { parseWindowsGuid } from \"win-guid\";\r\n\r\nconst bytes = parseWindowsGuid(\"00020906-0000-0000-C000-000000000046\");\r\n```\r\ninto a 16-byte Uint8Array using Windows GUID byte order.\r\n- Input is validated strictly\r\n- Case-insensitive\r\n- Throws an error on invalid input\r\n\r\n### Use the Guid helper class\r\n\r\nCreates a GUID from a canonical GUID string.\r\n```js\r\nimport { Guid } from \"win-guid\";\r\n\r\nconst guid = Guid.fromString(\"00020906-0000-0000-C000-000000000046\");\r\n```\r\n\r\n## API\r\n\r\n`parseWindowsGuid(guid: string): Uint8Array`\r\n\r\nParses a canonical GUID string:\r\n```js\r\nconst bytes = parseWindowsGuid(\"00020906-0000-0000-C000-000000000046\");\r\n```\r\n\r\ninto a 16-byte `Uint8Array` using Windows GUID byte order.\r\n\r\n- Input is validated strictly\r\n- Case-insensitive\r\n- Throws Error on invalid input\r\n\r\n`class Guid`\r\n\r\nCreates a GUID from a canonical GUID string.\r\n\r\n```js\r\nconst guid = Guid.fromString(\"00020906-0000-0000-C000-000000000046\");\r\n```\r\n\r\n`guid.toString(): string`\r\n\r\nConverts the GUID back into the canonical string form.\r\n\r\n- Always uppercase\r\n- Round-trips cleanly with fromString\r\n\r\n```js\r\nguid.toString();\r\n```\r\nOutputs something like:\r\n```\r\n00020906-0000-0000-C000-000000000046`\r\n```\r\n\r\n`guid.bytes: Uint8Array`\r\n\r\nProvides access to the raw 16-byte GUID in Windows legacy GUID byte order.\r\n\r\n```js\r\nconst bytes = guid.bytes;\r\n```\r\n\r\n## Licence\r\n\r\nThis project is licensed under the [MIT License](LICENSE.txt). Feel free to use, modify, and distribute as needed.\r\n","readmeFilename":"README.md"}