# format for hashes\codes
```json=
{
ncit:"938422934232",
gtin:"012345678905",
hashtype:"sha512",
sercet:"bjhdsjbcjebrffvnkjkerre",
}
```
хеш вычисляется из всех полей приведенных к нижнему регистру и отсортированных по алфавиту, к примеру:
```
hash = sha512(${ncit}+${gtin}+${hashtype}+${sercet})
hash = sha512(938422934232012345678905sha512bjhdsjbcjebrffvnkjkerre)
```
Ссыдка которая вшивается в QR имеет вид:
```
https://ncit.gov.ua/${ncid}?gtin=${gtin}&hashtype=${hashtype}&sercet=${sercet}
```
[Пример реализации sha512](https://emn178.github.io/online-tools/sha512.html)
https://ncit.gov.ua/938422934232?gtin=012345678905&hashtype=sha512&sercet=$bjhdsjbcjebrffvnkjkerre
[link to example qr](https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://ncit.gov.ua/938422934232?gtin=012345678905&hashtype=sha512&sercet=$bjhdsjbcjebrffvnkjkerre&choe=UTF-8)
Для EAN-13
В коде содержится 12 знаков, контрольный знак рассчитывается относительно стандарта.
Для кода: 123456789012 получится вот такая картинка:

где 8 является контрольным числом расчитанным по алгоритму из [статьи](https://magenta.su/info/article/podrobno-o-shtrih-kode-ean-13.html)
Gtin API responce example
```json
{
"product": {
"Id": 20275799,
"CompanyName": "ALL 4 U LLC",
"CompanyURI":
"/company/v3/company/GLN/0192408000000",
"Prefix": "0192408",
"GTIN": "00192408145701",
"GTIN13": "",
"GTIN12": "192408145701",
"PackagingLevel": "Each",
"Industry": "General",
"EntityGLN": "0192408000000",
"ProductDescription": "USS Widgeon ASR-1
License Plate Frame",
"ProductDescriptionLanguage1": "en",
"ProductDescription2": "",
"ProductDescriptionLanguage2": "",
"SKU": "LSFASR-1",
"BrandName": "MilitaryBest",
"BrandNameLanguage1": "en",
"BrandName2": "",
"BrandNameLanguage2": "",
"Status": "In Use",
"IsVariable": false,
"IsPurchasable": false,
"Dimensions": {
"Height": null,
"Width": null,
"Depth": null,
"DimensionMeasure": ""
},
"Weight": {
"GrossWeight": null,
"NetWeight": null,
"WeightMeasure": ""
},
"Comments": null,
"TargetMarket": [],
"ChildGTINs": null,
"Quantity": null,
"SubBrandName": "",
"ProductDescriptionShort": "",
"LabelDescription": "",
Data Hub Developer Developer's Portal User Guide 19
Appendix A: Sample Product API Search Results (cont)
"NetPackageContent": {
"NetContent1Count": "",
"NetContent1UnitOfMeasure": "",
"NetContent2Count": "",
"NetContent2UnitOfMeasure": "",
"NetContent3Count": "",
"NetContent3UnitOfMeasure": ""
},
"GlobalProductClassification": "",
"ImageURL": "",
"Ancestors": [],
"Descendants": [],
"IsEnhanced": "",
"ModifiedDate": "2017-10-
10T21:07:24.5700000Z"
},
"messages": [],
"responseCode": "VB0001",
"responseMessage": "Product lookup is
successful"
}
```