Description: drop this commit that uses an unavailable module
Author: Yadd <yadd@debian.org>
Forwarded: not-needed
Last-Update: 2025-08-10

--- a/lib/to-buffer.js
+++ b/lib/to-buffer.js
@@ -1,20 +1,16 @@
 'use strict';
 
 var Buffer = require('safe-buffer').Buffer;
-var toBuffer = require('to-buffer');
-
-var useUint8Array = typeof Uint8Array !== 'undefined';
-var useArrayBuffer = useUint8Array && typeof ArrayBuffer !== 'undefined';
-var isView = useArrayBuffer && ArrayBuffer.isView;
 
 module.exports = function (thing, encoding, name) {
-	if (
-		typeof thing === 'string'
-		|| Buffer.isBuffer(thing)
-		|| (useUint8Array && thing instanceof Uint8Array)
-		|| (isView && isView(thing))
-	) {
-		return toBuffer(thing, encoding);
+	if (Buffer.isBuffer(thing)) {
+		return thing;
+	}
+	if (typeof thing === 'string') {
+		return Buffer.from(thing, encoding);
+	}
+	if (ArrayBuffer.isView(thing)) {
+		return Buffer.from(thing.buffer);
 	}
-	throw new TypeError(name + ' must be a string, a Buffer, a Uint8Array, or a DataView');
+	throw new TypeError(name + ' must be a string, a Buffer, a typed array or a DataView');
 };
--- a/test/index.js
+++ b/test/index.js
@@ -14,8 +14,6 @@
 var js = require('../browser');
 var browserImpl = require('../lib/sync-browser');
 
-var errMsg = function (name) { return new RegExp(name + ' must be a string, a Buffer, a Uint8Array, or a DataView'); };
-
 var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10);
 /* istanbul ignore next */
 if (pVersionMajor !== 4 || process.browser) {
@@ -110,29 +108,25 @@
 	tape(name + ' should throw if the password is not a string or an ArrayBuffer', function (t) {
 		t.plan(2);
 
-		t['throws'](
-			function () { compat.pbkdf2(['a'], 'salt', 1, 32, 'sha1', function () {}); },
-			errMsg('Password')
-		);
+		t['throws'](function () {
+			compat.pbkdf2(['a'], 'salt', 1, 32, 'sha1', function () {});
+		}, /Password must be a string, a Buffer, a typed array or a DataView/);
 
-		t['throws'](
-			function () { compat.pbkdf2Sync(['a'], 'salt', 1, 32, 'sha1'); },
-			errMsg('Password')
-		);
+		t['throws'](function () {
+			compat.pbkdf2Sync(['a'], 'salt', 1, 32, 'sha1');
+		}, /Password must be a string, a Buffer, a typed array or a DataView/);
 	});
 
 	tape(name + ' should throw if the salt is not a string or an ArrayBuffer', function (t) {
 		t.plan(2);
 
-		t['throws'](
-			function () { compat.pbkdf2('pass', ['salt'], 1, 32, 'sha1'); },
-			errMsg('Salt')
-		);
+		t['throws'](function () {
+			compat.pbkdf2('pass', ['salt'], 1, 32, 'sha1');
+		}, /Salt must be a string, a Buffer, a typed array or a DataView/);
 
-		t['throws'](
-			function () { compat.pbkdf2Sync('pass', ['salt'], 1, 32, 'sha1'); },
-			errMsg('Salt')
-		);
+		t['throws'](function () {
+			compat.pbkdf2Sync('pass', ['salt'], 1, 32, 'sha1');
+		}, /Salt must be a string, a Buffer, a typed array or a DataView/);
 	});
 
 	var algos = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'ripemd160'];
@@ -259,7 +253,7 @@
 		for (var implName in impls) { // eslint-disable-line no-restricted-syntax
 			var pbkdf2Sync = impls[implName];
 			try {
-				var key = pbkdf2Sync('secret', 'salt', 1e4, 64, algo).toString('hex');
+				var key = pbkdf2Sync('secret', 'salt', 100000, 64, algo).toString('hex');
 				results[implName] = key;
 				t.doesNotMatch(key, /^0+$/, implName + ' does not return all zeros for ' + algo);
 			} catch (e) {
