Skip to content
This repository
Browse code

[enhance] stdlib, server: no more ursa dependency

  • Loading branch information...
commit 9f2b8f8ea132b04b01f1c59543ad35a5137971eb 1 parent a3b650d
Cédric Soulas cedricss authored
13 lib/plugins/server/bslMisc.nodejs
... ... @@ -0,0 +1,13 @@
  1 +var Crypto = require('crypto');
  2 +
  3 +/**
  4 + * Compute the MD5 signature of a string.
  5 + *
  6 + * @register {string -> string}
  7 + */
  8 +function md5(data) {
  9 + var hash = Crypto.createHash('md5');
  10 + hash.update(data);
  11 + return hash.digest('hex');
  12 +}
  13 +
1  lib/plugins/server/server.opa_plugin
@@ -7,6 +7,7 @@ bslJson.js
7 7 bslJson.nodejs
8 8 bslServer_event.nodejs
9 9 bslI18n.js
  10 +bslMisc.nodejs
10 11
11 12 actor.js
12 13 actor.nodejs
4 lib/stdlib/core/web/server/server_private.opa
@@ -11,7 +11,7 @@
11 11 */
12 12
13 13 import stdlib.core.{parser, date, rpc.core, web.{core,resource,request}, xhtml, args, i18n}
14   -import-plugin {crypto, unix, server}
  14 +import-plugin {unix, server}
15 15
16 16
17 17 /**
@@ -194,7 +194,7 @@ Server_private = {{
194 194 js_code = Client_code.retrieve_js_file()
195 195
196 196 //As some bits of the JS are generated at launch-time and can be randomized (e.g. @public sessions), the server id isn't sufficient
197   - js_unique_stamp = %% BslCrypto.md5 %%(js_code)
  197 + js_unique_stamp = %% BslMisc.md5 %%(js_code)
198 198 js_file_no_internal_without_version = "code/all.js"
199 199 js_file_no_internal_with_version = "{js_unique_stamp}/{js_file_no_internal_without_version}"
200 200 js_file_with_version = "{base_url_string}/{_internal_}/{js_file_no_internal_with_version}"

0 comments on commit 9f2b8f8

Please sign in to comment.
Something went wrong with that request. Please try again.