summaryrefslogtreecommitdiff
path: root/tests/monster_test.fbs
diff options
context:
space:
mode:
authorAlex Ames <amablue@google.com>2015-02-13 15:58:29 -0800
committerAlex Ames <amablue@google.com>2015-02-17 14:10:18 -0800
commitd575321eba7f83f40de5fb23685ed3cdb47bc9cc (patch)
treec5c28db4f838a3e5d9cd5dece77acda7fe197296 /tests/monster_test.fbs
parent620fe1c5cf23f5dd4e9d734e1029c6c772f0f811 (diff)
downloadflatbuffers-d575321eba7f83f40de5fb23685ed3cdb47bc9cc.tar.gz
flatbuffers-d575321eba7f83f40de5fb23685ed3cdb47bc9cc.tar.bz2
flatbuffers-d575321eba7f83f40de5fb23685ed3cdb47bc9cc.zip
Added the hash attribute to ints and longs.
FlatBuffer schema files can now optionally specify a hash attribute that will allow someone writing json files to enter a string to be hashed rather than a specific value. The hashing algorithm to use is specified by the schema. Currently the only algorithms are fnv1 and fnv1a. There are 32 bit and 64 variatns for each. Additionally, a hashing command line tool was added so that you can see what a string will hash to without needing to inspect the flatbuffer binary blob. Change-Id: I0cb359d0e2dc7d2dc1874b446dc19a17cc77109d
Diffstat (limited to 'tests/monster_test.fbs')
-rwxr-xr-xtests/monster_test.fbs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/monster_test.fbs b/tests/monster_test.fbs
index 01b9e596..26106574 100755
--- a/tests/monster_test.fbs
+++ b/tests/monster_test.fbs
@@ -44,6 +44,14 @@ table Monster {
testnestedflatbuffer:[ubyte] (id:13, nested_flatbuffer: "Monster");
testempty:Stat (id:14);
testbool:bool (id:15);
+ testhashs32_fnv1:int (id:16, hash:"fnv1_32");
+ testhashu32_fnv1:uint (id:17, hash:"fnv1_32");
+ testhashs64_fnv1:long (id:18, hash:"fnv1_64");
+ testhashu64_fnv1:ulong (id:19, hash:"fnv1_64");
+ testhashs32_fnv1a:int (id:20, hash:"fnv1a_32");
+ testhashu32_fnv1a:uint (id:21, hash:"fnv1a_32");
+ testhashs64_fnv1a:long (id:22, hash:"fnv1a_64");
+ testhashu64_fnv1a:ulong (id:23, hash:"fnv1a_64");
}
root_type Monster;