Skip to end of metadata
Go to start of metadata


This article describes how to create a voice pick code or voiceCode on a label used for shipping produce using field level scripting.

The Voice Pick standard calculation developed by YottaMark, Inc. for the voice data entry code is outlined in this document. 


The PMA (Produce Marketing Association), CPMA (Canadian Produce Marketing Association), United Fresh, retailers, and dozens of shippers have endorsed the Produce Traceability Initiative (PTI) to implement a whole chain traceability system for produce supply chains.

The PTI requires that every case of produce have a label with a barcode incorporating a 14 digit GTIN, a Lot Code, and an optional date code.

However, in practice it is difficult for larger distribution centers to scan each barcode label on each case as the cases are received or picked for shipping.

The Voice Pick Code was developed to eliminate the need for scanning barcodes while picking cases for palletizing or receiving, and relies on the GTINs and Lot Codes being pre-entered into the Warehouse Management System (WMS) using an advanced shipping notice, or Hybrid Pallet Tag. Then when the individual cases are loaded the voice code alone is sufficient to identify the case, GTIN, and Lot Code.  

The voice code is a verbal data entry system to identify the carton being picked from pre-entered data.

When all cases on a pallet have the same GTIN and Lot Code, then it is sufficient to confirm the quantity of cases picked.

If cases are picked from a mixed pallet containing multiple GTIN and Lot Codes, then the Voice Code can be used to identify which GTIN and Lot Code is being picked without the need to scan the barcode. 

On the sample label below, the warehouse worker would speak the number "59", or on a mixed pallet possibly the code "98 59" and the quantity of the cases being picked to update their pick list.

The code generating script:

// VoiceCode Calculation
// A VoiceCode is a 4 digit number computed using the GTIN, Lot, and optional Date from a PTI Case Label representing a hash of this information.
// This computation is performed as follows:
// PlainText is the 14 digit GTIN appended by the Lot Code and the Date (YYMMDD) in that order.
//  - Do not include the application identifier, prefixes or parentheses, spaces or date formatting characters
// Compute ANSI CRCX16 Hash of the PlainText ASCII bytes using the standard ANSI CRCX16 hash with the polynomial of X16 + X15 + X2 + 1
// Compute the VoiceCode  from the Hash 

//Print the two least significant digits large, and the two most significant digits small
// Example:
// GTIN = (01) 10850510002011
// Lot = (10) 46587443HG234
// PlainText = 1085051000201146587443HG234
// CRCX16 Hash = 26359
// VoiceCode = 6359
// Large Digits = 59
// Small Digits = 63
// Label Assumptions (case sensitive label field names)
// 1) There are three fields on your label named GTIN, LOT and PTIDATE to get the data to be used in this calculation
// 2) There are two fields on your label named largeDigits, smallDigits to set your voice pick values

// set cyclic redundancy check table
var crcTable = new Array(

// get label data GTIN & LOT & PTI DATE
var plainText = String(label.fields.field.(@name == 'GTIN').@data) + String(label.fields.field.(@name == 'LOT').@data) + String(label.fields.field.(@name == 'PTIDATE').@data);

var len = plainText.length;
var n;
var crc;

// set crc
crc = 0;

// calculate crc 
for (n = 0; n < len; n++)
crc = crcAdd(crc, plainText.charCodeAt(n));

// set small and large digits on your label
var voiceCode = crc.toString();

label.fields.field.(@name =='largeDigits').@data = voiceCode.slice(-2);

label.fields.field.(@name =='smallDigits').@data = voiceCode.slice(-4,-2);


function crcAdd(crc,c)
return crcTable[(crc ^ c) & 0xFF] ^ ((crc >> 8) & 0xFF);

For additional information into the Voice Pick code standard and the Produce Traceability Initiative, see

For additional information on CRC check calculations, see

Article Number



All versions that support field level scripting


Any supported LPS family product environment