Commit graph

12 commits

Author SHA1 Message Date
Tobie Morgan Hitchcock
001d7f866c Prevent datarace, by not using global variable when decoding
Don’t use the global variable ‘skip’ to decode into, as this causes a data race, when decoding keys from inside multiple different goroutines. Instead we now create a new string variable for every decode function, which will be created on the heap and ignored when the function returns.
2017-12-01 00:34:44 +00:00
Tobie Morgan Hitchcock
e300e9c423 Improve efficiency of database key encoding and decoding
Make use of the github.com/abcum/bump package to efficiently encode and decode from and to byte slices, whilst at the same time using encoder and decoder pools, instead of creating a new buffer for each encoding / decoding process.
2017-11-16 20:18:42 +00:00
Tobie Morgan Hitchcock
f56196a150 Update keys package 2017-02-09 20:35:19 +00:00
Tobie Morgan Hitchcock
8791fb4cfd Improve code comments 2016-10-14 21:26:26 +01:00
Tobie Morgan Hitchcock
fdb639e517 Simplify variables 2016-10-14 07:14:05 +01:00
Tobie Morgan Hitchcock
529ddbbec2 Encode all numbers as float64
All numbers in encoded keys are now encoded into float64, ensuring that decimal numbers are sorted alongside integers.

The maximum number able to be stored as a float64, without losing precision, is now (1<<53 - 1) - the same maximum number possible in javascript.
2016-09-10 00:21:58 +01:00
Tobie Morgan Hitchcock
485475d7f3 Ensure EndOfTime is always in the future 2016-05-31 13:35:08 +01:00
Tobie Morgan Hitchcock
f795c97c22 Add variables for begging and end of time 2016-05-31 11:24:10 +01:00
Tobie Morgan Hitchcock
e69ae69e4f Add ability to ignore struct fields when encoding keys 2016-05-27 16:25:46 +01:00
Tobie Morgan Hitchcock
5e2241f77a Hide Prefix and Suffix characters from public 2016-05-23 13:31:41 +01:00
Tobie Morgan Hitchcock
7addcd8289 Latest implementation of key encoding+decoding 2016-05-18 00:55:50 +01:00
Tobie Morgan Hitchcock
07139fdc5b Add database keys package
The keys package is used to encode and decode keys. Keys are used for storage in the key:value store.
2016-03-15 21:30:47 +00:00