Core Function BinaryWipe

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
m (1 revision)
 
(5 intermediate revisions by one user not shown)
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
  
Wipes a binary variables data 100% and sets the variable to a blank int containing just 0.
+
Wipes a binary variables data 100% and sets the variable to a blank int containing null.
  
 
=== Parameters ===
 
=== Parameters ===
Line 21: Line 21:
 
=== Remarks ===
 
=== Remarks ===
  
This will only wipe this individual variable it will not wipe every variable containing a reference to this binary data.
+
This will wipe not only this variable but all variables that are using to this binary variable as a ref etc.
 
+
What this means is its quite possible you will free no memory from using this unless you also wipe all other binary variables using this data.
+
  
 
=== Example ===
 
=== Example ===
  
 
<syntaxhighlight lang="sputnik">
 
<syntaxhighlight lang="sputnik">
$binary = Pack("z0", "Hello World!\n" x 1000);
+
$binary = Pack("A*", "Hello World!\n" x 1000);
println( "Before Wipe: " . Unpack("z0", $binary) );
+
println( "Before Wipe: " . Unpack("A*", $binary, 3) );
 
BinaryWipe($binary);
 
BinaryWipe($binary);
println( "After Wipe: " . $binary );
 
</syntaxhighlight>
 
 
This is just as effective.
 
 
<syntaxhighlight lang="sputnik">
 
$binary = Pack("z0", "Hello World!\n" x 1000);
 
println( "Before Wipe: " . Unpack("z0", $binary) );
 
$binary = 0;
 
 
println( "After Wipe: " . $binary );
 
println( "After Wipe: " . $binary );
 
</syntaxhighlight>
 
</syntaxhighlight>
Line 46: Line 35:
  
 
<syntaxhighlight lang="sputnik">
 
<syntaxhighlight lang="sputnik">
$binary = Pack("z0", "Hello World!\n" x 1000);
+
$binary = Pack("A*", "Hello World!\n" x 1000);
println( "Before Wipe: " . Unpack("z0", $binary) );
+
println( "Before Wipe: " . Unpack("A*", $binary, 3) );
 
unset($binary);
 
unset($binary);
 
println( "After Wipe: " . $binary );
 
println( "After Wipe: " . $binary );

Latest revision as of 12:38, 14 June 2015

BinaryWipe( <binary-array> )

Contents

Description

Wipes a binary variables data 100% and sets the variable to a blank int containing null.

Parameters

binary-array

The binary variable to wipe.

Return Value

Success: Returns 1.

Failure: Returns 0.

Remarks

This will wipe not only this variable but all variables that are using to this binary variable as a ref etc.

Example

$binary = Pack("A*", "Hello World!\n" x 1000);
println( "Before Wipe: " . Unpack("A*", $binary, 3) );
BinaryWipe($binary);
println( "After Wipe: " . $binary );

Also, this is just as effective.

$binary = Pack("A*", "Hello World!\n" x 1000);
println( "Before Wipe: " . Unpack("A*", $binary, 3) );
unset($binary);
println( "After Wipe: " . $binary );
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox