This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bin | |
.temp | |
report.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import haxe.io.Bytes; | |
import haxe.Resource; | |
import openfl.Assets; | |
import openfl.display.Bitmap; | |
import openfl.display.BitmapData; | |
import openfl.display.Loader; | |
import openfl.utils.ByteArray; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Macro Compiler Define example | |
* | |
* Shows how to use a compiler configuration macro to set up more "defines" based | |
* on an existing define. | |
* | |
* Jason O'Neil 2013. Use as you please. | |
* | |
* haxe -D mydebug --macro "MacroDefine.setDefines()" -x MacroDefine.hx | |
* -- traces "A" and "B" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import haxe.macro.Context; | |
import haxe.macro.Expr; | |
using haxe.macro.ExprTools; | |
class Main | |
{ | |
inline static var QUOTED_FIELD_PREFIX = "@$__hx__"; | |
static function main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Handlebars Localisation Helper | |
// Source: https://gist.github.com/tracend/3261055 | |
Handlebars.registerHelper('l10n', function(keyword) { | |
var lang = (navigator.language) ? navigator.language : navigator.userLanguage; | |
// pick the right dictionary (if only one available assume it's the right one...) | |
var locale = window.locale[lang] || window.locale['en-US'] || window.locale || false; | |
// exit now if there's no data | |
if( !locale ) return target; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ecdsa | |
import ecdsa.ellipticcurve as EC | |
curve = ecdsa.SECP256k1 | |
x = int('11db93e1dcdb8a016b49840f8c53bc1eb68a382e97b1482ecad7b148a6909a5c', 16) | |
y = int('b2e0eaddfb84ccf9744464f82e160bfa9b8b64f9d4c03f999b8643f656b412a3', 16) | |
point = EC.Point(curve.curve, x, y) | |
pubkey = ecdsa.VerifyingKey.from_public_point(point, curve) | |
hash1 = 90774958364900180671716888080665726921328827653065727390791155349203800699667 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// main.js | |
import Vue from 'vue' | |
Vue.prototype.$store = new Vue({ | |
data: { | |
firstName: 'Foo', | |
lastName: 'Bar' | |
}, | |
computed: { | |
fullName: function () { | |
return this.firstName + ' ' + this.lastName |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function encrypt (msg, pass) { | |
var salt = CryptoJS.lib.WordArray.random(128/8); | |
var key = CryptoJS.PBKDF2(pass, salt, { | |
keySize: keySize/32, | |
iterations: iterations | |
}); | |
var iv = CryptoJS.lib.WordArray.random(128/8); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AESDecrypt = function (ciphertext, key) { | |
var keybuf = bsv.crypto.Hash.sha256(key.toBuffer()) | |
var key = CryptoJS.enc.Hex.parse(keybuf.slice(0, 8).toString('hex')); | |
var iv = CryptoJS.enc.Hex.parse(keybuf.slice(8, 16).toString('hex')); | |
var decrypt = CryptoJS.AES.decrypt(ciphertext, key, { iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 }); | |
var decryptedStr = decrypt.toString(CryptoJS.enc.Utf8); | |
return decryptedStr.toString(); | |
} | |
const AESEncrypt = function (plaintext, key) { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer