Best JavaScript code snippet using best
batocera-systems
Source:batocera-systems
...745class BiosStatus:746 MISSING = "MISSING"747 UNTESTED = "UNTESTED"748def md5sum(filename, blocksize=65536):749 hash = md5()750 with open(filename, "rb") as f:751 for block in iter(lambda: f.read(blocksize), b""):752 hash.update(block)753 return hash.hexdigest()754def checkBios(systems, prefix):755 missingBios = {}756 for system in systems.keys():757 for file in systems[system]["biosFiles"]:758 filepath = prefix + "/" + file["file"]759 if isfile(filepath):760 md5 = md5sum(filepath)761 if md5 != file["md5"] and file["md5"] != "":762 if system not in missingBios:763 missingBios[system] = {}...
bl_test.py
Source:bl_test.py
...35 import bpy36 for scene in bpy.data.scenes:37 for obj in scene.objects:38 scene.objects.unlink(obj)39def blend_to_md5():40 import bpy41 scene = bpy.context.scene42 ROUND = 443 def matrix2str(matrix):44 return "".join([str(round(axis, ROUND)) for vector in matrix for axis in vector]).encode('ASCII')45 def coords2str(seq, attr):46 return "".join([str(round(axis, ROUND)) for vertex in seq for axis in getattr(vertex, attr)]).encode('ASCII')47 import hashlib48 md5 = hashlib.new("md5")49 md5_update = md5.update50 for obj in scene.objects:51 md5_update(matrix2str(obj.matrix_world))52 data = obj.data53 if type(data) == bpy.types.Mesh:54 md5_update(coords2str(data.vertices, "co"))55 elif type(data) == bpy.types.Curve:56 for spline in data.splines:57 md5_update(coords2str(spline.bezier_points, "co"))58 md5_update(coords2str(spline.points, "co"))59 return md5.hexdigest()60def main():61 argv = sys.argv62 print(" args:", " ".join(argv))63 argv = argv[argv.index("--") + 1:]64 def arg_extract(arg, optional=True, array=False):65 arg += "="66 if array:67 value = []68 else:69 value = None70 i = 071 while i < len(argv):72 if argv[i].startswith(arg):73 item = argv[i][len(arg):]74 del argv[i]75 i -= 176 if array:77 value.append(item)78 else:79 value = item80 break81 i += 182 if (not value) and (not optional):83 print(" '%s' not set" % arg)84 sys.exit(1)85 return value86 run = arg_extract("--run", optional=False)87 md5 = arg_extract("--md5", optional=False)88 md5_method = arg_extract("--md5_method", optional=False) # 'SCENE' / 'FILE'89 # only when md5_method is 'FILE'90 md5_source = arg_extract("--md5_source", optional=True, array=True)91 # save blend file, for testing92 write_blend = arg_extract("--write-blend", optional=True)93 # ensure files are written anew94 for f in md5_source:95 if os.path.exists(f):96 os.remove(f)97 import bpy98 replace_bpy_app_version()99 if not bpy.data.filepath:100 clear_startup_blend()101 print(" Running: '%s'" % run)102 print(" MD5: '%s'!" % md5)103 try:104 result = eval(run)105 except:106 import traceback107 traceback.print_exc()108 sys.exit(1)109 if write_blend is not None:110 print(" Writing Blend: %s" % write_blend)111 bpy.ops.wm.save_mainfile('EXEC_DEFAULT', filepath=write_blend)112 print(" Result: '%s'" % str(result))113 if not result:114 print(" Running: %s -> False" % run)115 sys.exit(1)116 if md5_method == 'SCENE':117 md5_new = blend_to_md5()118 elif md5_method == 'FILE':119 if not md5_source:120 print(" Missing --md5_source argument")121 sys.exit(1)122 for f in md5_source:123 if not os.path.exists(f):124 print(" Missing --md5_source=%r argument does not point to a file")125 sys.exit(1)126 import hashlib127 md5_instance = hashlib.new("md5")128 md5_update = md5_instance.update129 for f in md5_source:130 filehandle = open(f, "rb")131 md5_update(filehandle.read())...
md5.js
Source:md5.js
...10var util = Crypto.util;1112// Public API13var MD5 = Crypto.MD5 = function (message, options) {14 var digestbytes = util.wordsToBytes(MD5._md5(message));15 return options && options.asBytes ? digestbytes :16 options && options.asString ? util.bytesToString(digestbytes) :17 util.bytesToHex(digestbytes);18};1920// The core21MD5._md5 = function (message) {2223 var m = util.stringToWords(message),24 l = message.length * 8,25 a = 1732584193,26 b = -271733879,27 c = -1732584194,28 d = 271733878;
...
Using AI Code Generation
1var bc = require('bestcrypt');2var md5 = bc.md5('test');3console.log(md5);4var bc = require('bestcrypt');5var sha1 = bc.sha1('test');6console.log(sha1);7var bc = require('bestcrypt');8var sha256 = bc.sha256('test');9console.log(sha256);10var bc = require('bestcrypt');11var sha512 = bc.sha512('test');12console.log(sha512);13var bc = require('bestcrypt');14var sha256 = bc.sha256('test');15console.log(sha256);16var bc = require('bestcrypt');17var sha512 = bc.sha512('test');18console.log(sha512);19var bc = require('bestcrypt');20var sha256 = bc.sha256('test');21console.log(sha256);22var bc = require('bestcrypt');23var sha512 = bc.sha512('test');24console.log(sha512);25var bc = require('bestcrypt');26var sha256 = bc.sha256('test');27console.log(sha256);28var bc = require('bestcrypt');29var sha512 = bc.sha512('test');30console.log(sha512);31var bc = require('bestcrypt');32var sha256 = bc.sha256('test');33console.log(sha256);34var bc = require('bestcrypt');35var sha512 = bc.sha512('test');36console.log(sha512);
Using AI Code Generation
1var bestCrypt = require('bestcrypt');2var md5 = bestCrypt.md5('Hello World!');3console.log(md5);4var bestCrypt = require('bestcrypt');5var sha1 = bestCrypt.sha1('Hello World!');6console.log(sha1);7var bestCrypt = require('bestcrypt');8var sha256 = bestCrypt.sha256('Hello World!');9console.log(sha256);10var bestCrypt = require('bestcrypt');11var sha512 = bestCrypt.sha512('Hello World!');12console.log(sha512);13var bestCrypt = require('bestcrypt');14var sha3_256 = bestCrypt.sha3_256('Hello World!');15console.log(sha3_256);16var bestCrypt = require('bestcrypt');17var sha3_512 = bestCrypt.sha3_512('Hello World!');18console.log(sha3_512);19var bestCrypt = require('bestcrypt');20var ripemd160 = bestCrypt.ripemd160('Hello World!');21console.log(ripemd160);22var bestCrypt = require('bestcrypt');23var base64encode = bestCrypt.base64encode('Hello World!');24console.log(base64encode);25var bestCrypt = require('bestcrypt');26var base64decode = bestCrypt.base64decode('SGVsbG8gV29ybGQh');27console.log(base64decode);28var bestCrypt = require('bestcrypt');29var base64encodeUrlSafe = bestCrypt.base64encodeUrlSafe('Hello World!');30console.log(base64encodeUrlSafe);
Using AI Code Generation
1var bc = new ActiveXObject("BestCrypt.BestCrypt");2var md5 = bc.md5("c:\\temp\\test.txt");3WScript.Echo(md5);4var bc = new ActiveXObject("BestCrypt.BestCrypt");5var sha1 = bc.sha1("c:\\temp\\test.txt");6WScript.Echo(sha1);7var bc = new ActiveXObject("BestCrypt.BestCrypt");8var sha256 = bc.sha256("c:\\temp\\test.txt");9WScript.Echo(sha256);10var bc = new ActiveXObject("BestCrypt.BestCrypt");11var sha512 = bc.sha512("c:\\temp\\test.txt");12WScript.Echo(sha512);13var bc = new ActiveXObject("BestCrypt.BestCrypt");14var sha3_256 = bc.sha3_256("c:\\temp\\test.txt");15WScript.Echo(sha3_256);
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!