forked from mdawsonuk/LevelDBDumper
/
idb_cmp1.go
38 lines (30 loc) · 1015 Bytes
/
idb_cmp1.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"bytes"
)
const (
// From https://source.chromium.org/chromium/chromium/src/+/master:content/browser/indexed_db/indexed_db_leveldb_coding.h;l=139
GLOBAL_METADATA int = 0
DATABASE_METADATA int = 1
OBJECT_STORE_DATA int = 2
EXISTS_ENTRY int = 3
INDEX_DATA int = 4
INVALID_TYPE int = 5
BLOB_ENTRY int = 6
)
// TODO: https://source.chromium.org/chromium/chromium/src/+/master:content/browser/indexed_db/indexed_db_leveldb_operations.cc?q=idb_cmp1
// https://stackoverflow.com/questions/35074659/how-to-access-google-chromes-indexeddb-leveldb-files
type idbCmp1 struct{}
func (idbCmp1) Compare(a, b []byte) int {
// TODO: https://source.chromium.org/chromium/chromium/src/+/master:content/browser/indexed_db/indexed_db_leveldb_coding.cc;l=840
return bytes.Compare(a, b)
}
func (idbCmp1) Name() string {
return "idb_cmp1"
}
func (idbCmp1) Separator(dst, a, b []byte) []byte {
return nil
}
func (idbCmp1) Successor(dst, b []byte) []byte {
return nil
}