File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# @digitalbazaar/http-digest-header Changelog
22
3+ ## 2.2.0 - 2025-10-dd
4+
5+ ### Changed
6+ - Eliminate dependencies in favor of native platform support for simple
7+ (and rarely used) polyfill fallbacks which may be removed in future
8+ versions. Dependencies removed:
9+ - ` @digitalbazaar/base64url-universal `
10+ - ` js-base64 ` .
11+
312## 2.1.0 - 2025-10-07
413
514### Added
Original file line number Diff line number Diff line change 11/*!
22 * Copyright (c) 2019-2025 Digital Bazaar, Inc. All rights reserved.
33 */
4- import { fromUint8Array as base64Encode } from 'js-base64' ;
5- import { encode as base64urlEncode } from 'base64url-universal' ;
4+ import { base64Encode , base64urlEncode } from './util.js' ;
65
76const { crypto} = globalThis ;
87
Original file line number Diff line number Diff line change 1+ /*!
2+ * Copyright (c) 2021-2025 Digital Bazaar, Inc. All rights reserved.
3+ */
4+ export function base64Encode ( bytes ) {
5+ if ( bytes . toBase64 ) {
6+ return bytes . toBase64 ( ) ;
7+ }
8+ return btoa ( Array . from ( bytes , b => String . fromCodePoint ( b ) ) . join ( '' ) ) ;
9+ }
10+
11+ export function base64urlEncode ( bytes ) {
12+ if ( bytes . toBase64 ) {
13+ return bytes . toBase64 ( { alphabet : 'base64url' , omitPadding : true } ) ;
14+ }
15+ return base64Encode ( bytes )
16+ . replace ( / \+ / g, '-' )
17+ . replace ( / \/ / g, '_' )
18+ . replaceAll ( '=' , '' ) ;
19+ }
Original file line number Diff line number Diff line change 1+ /*!
2+ * Copyright (c) 2021-2025 Digital Bazaar, Inc. All rights reserved.
3+ */
4+ export function base64Encode ( bytes ) {
5+ return Buffer . from ( bytes ) . toString ( 'base64' ) ;
6+ }
7+
8+ export function base64urlEncode ( bytes ) {
9+ return Buffer . from ( bytes ) . toString ( 'base64url' ) ;
10+ }
Original file line number Diff line number Diff line change 1414 },
1515 "type" : " module" ,
1616 "exports" : " ./lib/index.js" ,
17+ "browser" : {
18+ "./lib/util.js" : " ./lib/util-browser.js"
19+ },
1720 "files" : [
1821 " lib/**/*.js"
1922 ],
20- "dependencies" : {
21- "base64url-universal" : " ^2.0.0" ,
22- "js-base64" : " ^3.7.2"
23- },
2423 "devDependencies" : {
2524 "c8" : " ^10.1.3" ,
2625 "chai" : " ^4.3.6" ,
You can’t perform that action at this time.
0 commit comments