-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbling.cxx
43 lines (39 loc) · 1.25 KB
/
bling.cxx
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
39
40
41
42
43
/*
* =====================================================================================
*
* Filename: bling.cxx
*
* Description: Bling Hashes Native Impl
*
* Version: 1.0
* Created: 2015/09/11 11时11分54秒
* Revision: none
* Compiler: gcc
*
* Author: XadillaX <[email protected]>
*
* =====================================================================================
*/
#include <nan.h>
#include "byvoid/entry.h"
#include "cityhash/entry.h"
#include <string.h>
using Nan::Set;
using Nan::New;
using Nan::GetFunction;
using v8::FunctionTemplate;
using v8::String;
NAN_MODULE_INIT(InitAll)
{
// BYVoid hashes
Set(target, New<String>("calcHash").ToLocalChecked(),
GetFunction(New<FunctionTemplate>(CalcHash)).ToLocalChecked());
// City hashes
Set(target, New<String>("cityHash32").ToLocalChecked(),
GetFunction(New<FunctionTemplate>(_CityHash32)).ToLocalChecked());
Set(target, New<String>("cityHash64").ToLocalChecked(),
GetFunction(New<FunctionTemplate>(_CityHash64)).ToLocalChecked());
Set(target, New<String>("cityHash128").ToLocalChecked(),
GetFunction(New<FunctionTemplate>(_CityHash128)).ToLocalChecked());
}
NODE_MODULE(bling, InitAll)