Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@arms/rum-core

Package Overview
Dependencies
Maintainers
0
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arms/rum-core - npm Package Compare versions

Comparing version 0.0.25-beta.11 to 0.0.25-beta.13

3

lib/utils/base.d.ts

@@ -18,5 +18,6 @@ /**

* @param len {number}
* @param radix {number}
* @return {String}
*/
export declare function generateSpanId(len?: number): string;
export declare function generateSpanId(len?: number, radix?: number): string;
/**

@@ -23,0 +24,0 @@ * @description: 随机生成 eventId

@@ -37,4 +37,14 @@ "use strict";

guid = crypto.randomUUID();
} else if (crypto && crypto.getRandomValues) {
var buf = new Uint8Array(16);
crypto.getRandomValues(buf);
buf[6] = buf[6] & 0x0f | 0x40; // version 4 UUID
buf[8] = buf[8] & 0x3f | 0x80; // variant 10xxxxxx
guid = buf.reduce(function (str, _byte) {
return str + _byte.toString(16).padStart(2, '0');
}, '').replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/, '\$1-\$2-\$3-\$4-\$5');
}
} catch (e) {}
} catch (e) {
//
}
if (!guid) {

@@ -69,17 +79,17 @@ guid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {

* @param len {number}
* @param radix {number}
* @return {String}
*/
function generateSpanId(len) {
function generateSpanId(len, radix) {
if (len === void 0) {
len = 16;
}
var list = Array(len);
if (radix === void 0) {
radix = 16;
}
var result = '';
for (var i = 0; i < len; i++) {
list[i] = Math.floor(Math.random() * 16) + 48;
// valid hex characters in the range 48-57 and 97-102
if (list[i] >= 58) {
list[i] += 39;
}
result += Math.floor(Math.random() * radix).toString(radix);
}
return String.fromCharCode.apply(null, list);
return result;
}

@@ -86,0 +96,0 @@

{
"name": "@arms/rum-core",
"version": "0.0.25-beta.11",
"version": "0.0.25-beta.13",
"description": "arms rum javascript sdk core",

@@ -5,0 +5,0 @@ "author": "guangli.fj <guangli.fj@alibaba-inc.com>",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc