You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Core/CMP API Specification.md
+6
Original file line number
Diff line number
Diff line change
@@ -813,6 +813,12 @@ Valid data types are Integer and String. All other data types such as Boolean, D
813
813
</td>
814
814
</td>
815
815
</tr>
816
+
<tr>
817
+
<td><code>ArrayOfRanges<code></td>
818
+
<td>String</td>
819
+
<td><p>The key name will be combined by a static name and the key of the record. If the input data contains multiple records, the CMP SDK will create multiple keys, each with a combination of name and key.</p>
820
+
<p>The value consists of a sequence of "id:type"-pairs separated by underscore. E.g. "3:0_5:1_6:1_7:2_12:0"</p></td>
Copy file name to clipboardExpand all lines: Core/Consent String Specification.md
+27-15
Original file line number
Diff line number
Diff line change
@@ -594,68 +594,59 @@ In order to be backward compatible with IAB Europe’s TC String and US Privacy
594
594
595
595
A discrete section is encoded according to that specific section’s needs. This means today’s implementations that read and adapt to TCF v2.0 signals or US Privacy signals don't need to change their logic for a given discrete section of the string, as long as the implementation is aware of where the discrete section is.
596
596
597
-
598
597
New sections should follow the guidelines below. Guidelines like these help developers quickly adopt new sections and allow for parsing new sections without the need to reinvent new data types.
599
598
600
-
601
599
The possible data types are:
602
600
603
-
604
601
<table>
605
602
<tr>
606
603
<td><strong>Data Type</strong></td>
607
604
<td><strong>Encoding</strong></td>
608
605
<td><strong>JS API output</strong></td>
609
-
<td><strong>Description</strong></td>
610
-
<td> </td>
606
+
<td><strong>Description</strong></td>
611
607
</tr>
612
608
<tr>
613
609
<td><code>Boolean</code></td>
614
610
<td>1 bit</td>
615
611
<td>true|false</td>
616
612
<td>0=true, 1=false</td>
617
-
<td></td>
618
613
</tr>
619
614
<tr>
620
615
<td><code>Integer (fixed length of x)</code></td>
621
616
<td>x bit</td>
622
617
<td>Number</td>
623
618
<td>A fixed amount of bit representing an integer. Usual lengths are 3, 6 or 12 bit. <br><br> Example: int(6) “000101” represents the number 5</td>
624
-
<td></td>
625
619
</tr>
626
620
<tr>
627
621
<td><code>Integer (Fibonacci)</code></td>
628
622
<td>Variable Length</td>
629
623
<td>Number</td>
630
624
<td>Integer encoded using Fibonacci encoding <br><br> See <a href="https://github.com/InteractiveAdvertisingBureau/Global-Privacy-Platform/blob/main/Core/Consent%20String%20Specification.md#fibonacci-encoding-to-deal-with-string-length-"> “About Fibonacci Encoding” </a> for more detail</td>
631
-
<td></td>
632
625
</tr>
633
626
<tr>
634
627
<td><code>String (fixed length of x) (including country codes)</code></td>
635
628
<td>x*6 bit</td>
636
629
<td>String</td>
637
630
<td>A fixed amount of bit representing a string. The character’s ASCII integer ID is subtracted by 65 and encoded into an int(6). <br><br>Example: int(6) “101010” represents integer 47 + 65 = char “h”</td>
638
-
<td></td>
639
-
</tr>
631
+
</tr>
640
632
<tr>
641
633
<td><code>Datetime</code></td>
642
634
<td>36 bit</td>
643
635
<td>Date</td>
644
636
<td>A datetime is encoded as a 36 bit integer representing the 1/10th seconds since January 01 1970 00:00:00 UTC. <br><br>Example JavaScript representation: Math.round((new Date()).getTime()/100)</td>
645
-
<td></td>
646
637
</tr>
647
638
<tr>
648
639
<td><code>Bitfield (fixed length of x)</code></td>
649
640
<td>x bit</td>
650
641
<td>Array of Number</td>
651
642
<td>A fixed amount of bit. Usually each bit represents a boolean for an ID within a group where the first bit corresponds to true/false for ID 1, the second bit corresponds to true/false for ID 2 and so on.</td>
<td>Consists of two datapoints: a fixed length Integer(16) that denotes the length and a bitfield with that specific length.<br></br>Please note: Although the API reads/writes to fields (length + bitfield), it will only output the IDs from the bitfield via JS APIs.</td>
648
+
<td>Consists of two datapoints: a fixed length Integer(16) that denotes the length and a bitfield with that specific length.
649
+
<p>Please note: Although the API reads/writes to fields (length + bitfield), it will only output the IDs from the bitfield via JS APIs.</p></td>
@@ -709,7 +699,6 @@ Note: items may not be in sorted order.</td>
709
699
<li>Bits = 000000000010 0 0011 1 011 0011</li>
710
700
</ul>
711
701
Note: items MUST be in sorted order..</td>
712
-
<td></td>
713
702
</tr>
714
703
<tr>
715
704
<td><code>OptimizedRange</code></td>
@@ -736,6 +725,29 @@ Note: items MUST be in sorted order..</td>
736
725
</ul>
737
726
Note: This data type is used for downward compatibility only. OptimizedRange is the recommended data type to be used moving forward.</td>
738
727
</tr>
728
+
<tr>
729
+
<td><code>ArrayOfRanges</code></td>
730
+
<td>variable</td>
731
+
<td>[{'key':number, 'type':number, 'ids':Array of number}, {...}, ...]</td>
732
+
<td>Consists of a variable amount of fields:
733
+
<p><ul><li>First field is always of type Int(12). The value indicates the number of records to follow.</li></p>
734
+
<li>Each entry consists of three datatypes:</li>
735
+
<ul><li>key - Int(6)</li>
736
+
<li>type - Int(2)</li>
737
+
<li>ids - <code>OptimizedIntRange </code>(uses Range(Int) for range of IDs, see <code>OptimizedIntRange</code> data type above for more details)</li></ul></ul>
738
+
<p>Note: <code>ArrayOfRanges</code> is used for downwards compatibility only.</p></td>
739
+
</tr>
740
+
<tr>
741
+
<td><code>N-ArrayOfRanges(X,Y)</code></td>
742
+
<td>variable</td>
743
+
<td>[{'key':number, 'type':number, 'ids':Array of number}, {...}, ...]</td>
744
+
<td>Consists of a variable amount of fields:
745
+
<p><ul><li>First field is always of type Int(12). The value indicates the number of records to follow.</li></p>
746
+
<li>Each record consists of three datatypes:</li>
747
+
<ul><li><b>key</b> - Int(X) Where X is given by the field definition within the corresponding specification.</li>
748
+
<li><b>type</b> - Int(Y) Where Y is given by the field definition within the corresponding specification.</li>
749
+
<li><b>ids</b> - <code>OptimizedRange </code>(uses Fibonacci coding for range of IDs, see <code>OptimizedRange</code> data type above for more details)</li></ul></ul></td></td>
0 commit comments