Core Function BinaryWipe

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> BinaryWipe( <binary-array> ) </pre> === Description === Wipes a binary variables data 100% and sets the variable to a blank int containing just 0. === Parameters === ==...")
 
(Example)
Line 28: Line 28:
  
 
<syntaxhighlight lang="sputnik">
 
<syntaxhighlight lang="sputnik">
$binary = Pack("z0", ("Hello World!\n" x 1000))
+
$binary = Pack("z0", "Hello World!\n" x 1000);
println( "Before Wipe: " . Unpack("z0", $binary) )
+
println( "Before Wipe: " . Unpack("z0", $binary) );
BinaryWipe($binary)
+
BinaryWipe($binary);
println( "After Wipe: " . $binary )
+
println( "After Wipe: " . $binary );
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 37: Line 37:
  
 
<syntaxhighlight lang="sputnik">
 
<syntaxhighlight lang="sputnik">
$binary = Pack("z0", ("Hello World!\n" x 1000))
+
$binary = Pack("z0", "Hello World!\n" x 1000);
println( "Before Wipe: " . Unpack("z0", $binary) )
+
println( "Before Wipe: " . Unpack("z0", $binary) );
$binary = 0
+
$binary = 0;
println( "After Wipe: " . $binary )
+
println( "After Wipe: " . $binary );
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
[[Category:Core Function]]
 
[[Category:Core Function]]

Revision as of 17:28, 19 November 2011

BinaryWipe( <binary-array> )

Contents

Description

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

Parameters

binary-array

The binary variable to wipe.

Return Value

Success: Returns 1.

Failure: Returns 0.

Remarks

This will only wipe this individual variable it will not wipe every variable containing a referance to this binary data.

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

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

NOTE - This is just as effective

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